package com.ada.demo.controller;

import com.ada.mvcframework.annotations.MyController;
import com.ada.mvcframework.annotations.MyRequestMapping;
import com.ada.mvcframework.annotations.Security;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@MyController
@MyRequestMapping("/security")
public class SecurityController {
    /**
     * /security/method
     * @param request
     * @param response
     * @param name
     * @return
     */
    @MyRequestMapping("/method")
    @Security(value = {"wanger","zhangjun"})
    public void method(HttpServletRequest request, HttpServletResponse response, String name){
        try {
            response.getWriter().write("success!");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
